﻿using System.Web.Mvc;
using System.Web.Routing;

namespace www
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute(
               name: "Default",
               url: "{controller}/{action}/{cul}/{id}/{name}",
               defaults: new { controller = "Home", action = "Index",cul=UrlParameter.Optional, id = UrlParameter.Optional, name = UrlParameter.Optional }
           );

            routes.MapRoute(
               name: "DefaultClent",
               url: "{controller}/{action}/{cul}/{catId}/{id}/{name}",
               defaults: new { controller = "Home", action = "Index", cul = UrlParameter.Optional, catId = UrlParameter.Optional, id = UrlParameter.Optional, name = UrlParameter.Optional }
           );
           

            routes.MapRoute(
                name: "Advertise",
                url: "{controller}/{action}/{id}",
                defaults: new {controller = "Advertise", action = "Index", id = UrlParameter.Optional});

            routes.MapRoute(
                name: "Type",
                url: "{controller}/{action}/{id}",
                defaults: new {controller = "Type", action = "Index", id = UrlParameter.Optional});
            routes.MapRoute(
              name: "Category",
              url: "{controller}/{action}/{id}",
              defaults: new { controller = "Category", action = "Index", id = UrlParameter.Optional });
            routes.MapRoute(
               name: "Contact",
               url: "{controller}/{action}/{id}",
               defaults: new { controller = "Contact", action = "Index", id = UrlParameter.Optional });

            routes.MapRoute(
            name: "Staff",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Staff", action = "Index", id = UrlParameter.Optional });

            routes.MapRoute(
         name: "GrandRole",
         url: "{controller}/{action}/{id}",
         defaults: new { controller = "GrandRole", action = "Index", id = UrlParameter.Optional });

            routes.MapRoute(
           name: "AddRole",
           url: "GrandRole/AddRole/{menuId}/{staffId}",
           defaults: new { controller = "GrandRole", action = "AddRole", menuId = UrlParameter.Optional, staffId = UrlParameter.Optional });

            routes.MapRoute(
          name: "DeleteRole",
          url: "GrandRole/DeleteRole/{id}/{staffId}",
          defaults: new { controller = "GrandRole", action = "DeleteRole", id = UrlParameter.Optional, staffId = UrlParameter.Optional });

            routes.MapRoute(
        name: "Administrator",
        url: "Admin/Logon/{id}",
        defaults: new { controller = "Admin", action = "Logon", id = UrlParameter.Optional });

        }
    }
}